package com.cyandpos.pad.report.reportPresenter;

import com.cyandpos.pad.posdata.ClassNewspaperAndDaily;
import com.cyandpos.pad.report.reportModel.IReportModel;
import com.cyandpos.pad.report.reportModel.ReportModel;
import com.cyandpos.pad.report.reportView.IReportView;

/**
 * Created by Administrator on 2017/3/6/006.
 */

public class ReportPresent implements IReportPresenter,ReportModel.ReportDoModelListener {

    private IReportModel reportModel;
    private IReportView reportView;

    public ReportPresent(IReportView reportView) {
        this.reportView = reportView;
        reportModel = new ReportModel();
    }

    @Override
    public void reportData(int skyId) {
        reportView.showProgress();
        reportModel.doReportHttp(skyId,this);

    }

    @Override
    public void ReportDoModelSuccess(ClassNewspaperAndDaily daily) {
        reportView.hideProgress();
        reportView.onQueryDataSuccess(daily);

    }

    @Override
    public void ReportDoModelFailed(String errorMsg) {
        reportView.hideProgress();
        reportView.showLoadFailMsg(errorMsg);
    }


}
